<template>
    <div>
        <div class="grid-container">
            <div class="grid-item">1</div>
            <div class="grid-item">2</div>
            <div class="grid-item">3</div>
            <div class="grid-item">4</div>
            <div class="grid-item">5</div>
            <div class="grid-item">3</div>
            <div class="grid-item">4</div>
            <div class="grid-item">5</div>
            <div class="grid-item">5</div>
            <div class="grid-item">5</div>
            <div class="grid-item">51</div>
        </div>
    </div>
</template>

<script setup>
import { ref, reactive, onMounted, nextTick } from 'vue'

</script>
<style lang='scss' scoped>
.grid-container {
    width: 50%;
    border: 1px solid red;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 创建五个等宽的列 */
    grid-gap: 10px;
    /* 网格项之间的间隙 */
    padding: 10px;
    // display: flex
}

.grid-item {
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.8);
    padding: 20px;
    // text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    // width: 25%;
}

.grid-item>div:first-child {
    text-align: center;
}
</style>